#include <iostream>
#include <math.h>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int compare(int tianji, vector<int> &qiweiwang)
{
    int amount = 0;
    int n = qiweiwang.size();
    for (size_t i = 0; i < n; i++)
    {
        if (tianji > qiweiwang[i])
        {
            amount += 1;
            qiweiwang.erase(qiweiwang.begin() + i);
            return amount;
        }
        else if (tianji = qiweiwang[i])
        {
            qiweiwang.erase(qiweiwang.begin() + i);
            return amount;
        }
        else if (tianji < qiweiwang[i])
        {
            amount -= 1;
            qiweiwang.erase(qiweiwang.begin() + i);
            return amount;
        }
    }
    return amount;
}

void test()
{
    int n, temp, res = 0;
    vector<int> QiWeiWang;
    vector<int> TianJi;
    cin >> n;
    for (size_t i = 0; i < n; i++)
    {
        cin >> temp;
        QiWeiWang.push_back(temp);
    }
    for (size_t i = 0; i < n; i++)
    {
        cin >> temp;
        TianJi.push_back(temp);
    }
    sort(QiWeiWang.begin(), QiWeiWang.end());
    sort(TianJi.begin(), TianJi.end());
    for (size_t i = n - 1; i >= 0; i--)
    {
        temp = compare(TianJi[i], QiWeiWang);
        res += temp;
        cout << res << endl;
    }

    cout << res;
}

int main()
{
    test();
    return 0;
}